<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>QSimpleUpdater: Introduction</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="icon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QSimpleUpdater
   </div>
   <div id="projectbrief">A simple auto-updater system for Qt applications</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Introduction </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> is an implementation of an auto-updating system to be used with Qt projects. It allows you to easily check for updates, download them and install them. Additionally, the <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> allows you to check for updates for different "modules" of your application. Check the WTFs for more information.</p>
<h2>Integrating <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> with your projects</h2>
<ol type="1">
<li>Copy the <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> folder in your "3rd-party" folder.</li>
<li>Include the <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> project include (<em>pri</em>) file using the include() function.</li>
<li>That's all! Check the tutorial project as a reference for your project.</li>
</ol>
<h2>WTFs Section</h2>
<h3>1. How does the <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> check for updates?</h3>
<p>The <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> downloads an update definition file stored in JSON format. This file specifies the latest version, the download links and changelogs for each platform (you can also register your own platform easily if needed).</p>
<p>After downloading this file, the library analyzes the local version and the remote version. If the remote version is greater than the local version, then the library infers that there is an update available and notifies the user.</p>
<h3>2. Can I customize the update notifications shown to the user?</h3>
<p>Yes! You can "toggle" which notifications to show using the library's functions or re-implement by yourself the notifications by "reacting" to the signals emitted by the <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a>.</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;QString url = &quot;https://MyBadassApplication.com/updates.json&quot;;</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;QSimpleUpdater::getInstance()-&gt;setNotifyOnUpdate (url, true);</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;QSimpleUpdater::getInstance()-&gt;setNotifyOnFinish (url, false);</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;QSimpleUpdater::getInstance()-&gt;checkForUpdates (url);</div></div><!-- fragment --><h3>3. Is the application able to download the updates directly?</h3>
<p>Yes. If there is an update available, the library will prompt the user if he/she wants to download the update. You can enable or disable the integrated downloader with the following code:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;QString url = &quot;https://MyBadassApplication.com/updates.json&quot;;</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;QSimpleUpdater::getInstance()-&gt;setDownloaderEnabled (url, true);</div></div><!-- fragment --><h3>4. Why do I need to specify an URL for each function of the library?</h3>
<p>The <a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> allows you to use different updater instances, which can be accessed with the URL of the update definitions. While it is not obligatory to use multiple updater instances, this can be useful for applications that make use of plugins or different modules.</p>
<p>Say that you are developing a game, in this case, you could use the following code:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;// Update the game textures</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;QString textures_url = &quot;https://MyBadassGame.com/textures.json&quot;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;QSimpleUpdater::getInstance()-&gt;setModuleName    (textures_url, &quot;textures&quot;);</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;QSimpleUpdater::getInstance()-&gt;setModuleVersion (textures_url, &quot;0.4&quot;);</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;QSimpleUpdater::getInstance()-&gt;checkForUpdates  (textures_url);</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;// Update the game sounds</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;QString sounds_url = &quot;https://MyBadassGame.com/sounds.json&quot;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;QSimpleUpdater::getInstance()-&gt;setModuleName    (sounds_url, &quot;sounds&quot;);</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;QSimpleUpdater::getInstance()-&gt;setModuleVersion (sounds_url, &quot;0.6&quot;);</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;QSimpleUpdater::getInstance()-&gt;checkForUpdates  (sounds_url);</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;// Update the client (name &amp; versions are already stored in qApp)</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;QString client_url = &quot;https://MyBadassGame.com/client.json&quot;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;QSimpleUpdater::getInstance()-&gt;checkForUpdates (client_url);</div></div><!-- fragment --><h2>License</h2>
<p><a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a> is free and open-source software, it is released under the Don't Be A Dick License. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
